package com.quick.controller;

import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.quick.dy.dto.DyUserLoginDTO;
import com.quick.util.DecryptUtil;

import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@RequestMapping("dy/user")
public class DyUserLoginController {
	
	@PostMapping("login")
	public Boolean login(@RequestBody DyUserLoginDTO login) {
		try {
			String url = DecryptUtil.decrypt(login.getEncryptedData(), login.getSessionKey(), login.getIv());
			log.info(url);
		} catch (InvalidKeyException | NoSuchPaddingException | NoSuchAlgorithmException
				| InvalidAlgorithmParameterException | BadPaddingException | IllegalBlockSizeException e) {
			e.printStackTrace();
		}
		return null;
		
	}

}
